<?php
$title = 'My Task List';
$this->headTitle($title);
?>

<h1><?php echo $this->escapeHtml($title); ?></h1>
<p><a href="<?php echo $this->url('task', array('action'=>'add'));?>">Add new item</a></p>

<table class="table">
    <tr>
        <th>Task</th>
        <th>Created</th>
        <th>Completed?</th>
        <th>&nbsp;</th>
    </tr>
    <?php foreach($tasks as $task):?>
    <tr>
        <td>
            <a href="<?php echo $this->url('task',array('action'=>'edit', 'id' => $task->getId()));?>">
            <?php echo $this->escapeHtml($task->getTitle()); ?></a>
        </td>
        <td><?php echo $this->escapeHtml($task->getCreated()); ?></td>
        <td><?php echo $task->getCompleted() ? 'Yes' : 'No'; ?></td>
        <td>
        <a href="<?php echo $this->url('task',array('action'=>'delete', 'id' => $task->getId()));?>">Delete</a>
        </td>
    </tr>
    <?php endforeach; ?>
</table>

